from vanna.milvus.milvus_vector import Milvus_VectorStore
from pymilvus import MilvusClient

class Remote_Milvus_VectorStore(Milvus_VectorStore):
    def __init__(self, config=None):
        # 确保config不为空
        if config is None:
            config = {}
            
        # 从config中获取远程Milvus服务器URL,如果未提供则使用默认值
        milvus_url = config.get("milvus_url", "./milvus.db")
        
        # 创建远程Milvus客户端
        milvus_client = MilvusClient(uri=milvus_url)
        
        # 将milvus_client添加到config中
        config["milvus_client"] = milvus_client
        
        # 调用父类的__init__方法
        super().__init__(config=config)
